how to use eikon api to get bond info via bond Shanghai code?

Bond Shanghai code : 175143

Tagged:

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @xuke

    Thank you for reaching out to us.

    From my test, it doesn't work with the Shanghai Code but it works with ISIN.

    You can use the Refinitiv Data Library to search for ISIN and then retrieve the data by using ISIN or RIC. The examples are available on GitHub. You can use the desktop.workspace session by setting the application key (app-key) in the refinitiv-data.config.json and setting the default session to "desktop.workspace".

    1. Search for ISIN or RIC from the Shanghai Code

    df = rd.discovery.search(
        view = rd.discovery.Views.FIXED_INCOME_INSTRUMENTS,
        top = 10,
        filter = "(LocalCode eq '175143')",
        select = "BusinessEntity,DocumentTitle, RIC, ISIN,LocalCode"
    )
    df

    1691742896753.png

    2. Use ISIN or RIC to get the data

    rd.get_data(df["RIC"][0],["TR.RIC","TR.FIIssuerName","TR.FIMaturityDate","TR.FICouponType"])

    1691742944691.png

    You can use the Data Item Browser tool to search for other fields.

Answers

  • 20230811120956.png

    ISIN: CND10003TW70;

    Shanghai Code: 175143

  • ISIN: CND10003TW70;

    Shanghai Code: 175143

    20230811120956.png

  • @Jirapongse Thanks for your answer. One more question, how to search multiply localcodes at the same time? For example, local code 175143 and SHZ:133275

  • Hi @anchu ,

    Not sure if you've seen it yet, Jirapongse added the answer below in this thread

    My colleague @marcin.bunkowski01 found out that we can use these codes directly with the get_data method to get bond information. For example:

    rd.get_data(['133275','175143'],['TR.FIIssuerName','TR.FIMaturityDate','TR.FICouponType','TR.FICouponTypeDescription'])

    The output is:

    image

    You can use the Data Item Browser tool to search for availble fields.